package com.hnevc.yourhealthmanager.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnevc.yourhealthmanager.dto.WeightRecordDTO;
import com.hnevc.yourhealthmanager.entity.HealthPlane;
import com.hnevc.yourhealthmanager.entity.WeightRecord;
import com.hnevc.yourhealthmanager.dao.WeightRecordMapper;
import com.hnevc.yourhealthmanager.service.WeightRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WeightRecordServiceImpl extends ServiceImpl<WeightRecordMapper, WeightRecord> implements WeightRecordService {
    @Autowired
    WeightRecordMapper weightRecordMapper;
    @Override
    public List<WeightRecordDTO> getWeightRecordListByUserId(Integer userId) {
        return weightRecordMapper.getWeightRecordListByUserId(userId);
    }

    @Override
    public List<WeightRecordDTO> getWeightRecordListByHealthPlane(HealthPlane healthPlane) {
        return weightRecordMapper.getWeightRecordListByHealthPlane(healthPlane);
    }

    @Override
    public List<WeightRecordDTO> getWeightRecordListByPlaneMonth(HealthPlane healthPlane, Integer month, Integer year) {
        return weightRecordMapper.getWeightRecordListByPlaneMonth(healthPlane, month, year);
    }
}
